package com.ylxn.creator;

/**
 * 懒汉式
 */
public class Singleton02 {
    //私有构造方法
    private Singleton02(){}

    private static Singleton02 singleton02;

    public static synchronized Singleton02 getInstance(){
        if (singleton02==null){
            singleton02 = new Singleton02();
        }
        return singleton02;
    }
}
